<include file="../Public/header" />

        
		
		<script type="text/javascript">
			function sendTestMail() {
				receiver = $('#test_account').val();
				$.post("{:U('admin/System/doSendEmail')}", {receiver:receiver}, function(result){
					if(result == 1) {
						alert('发送完成，稍后请查收邮件～');
					}else {
						alert('发送失败～');
					}
				});
			}
		</script>
    </head>
    <body>
        <div id="container">
            <form action="{:U('admin/System/doSaveEmail')}" method="post" name="emailAdmin">
                <table width="100%" border="0" cellpadding="4" cellspacing="0" class="form">
                    <tr class="top">
                        <td colspan="2" class="tit">邮件设置</td>
                    </tr>
					<tr>
                        <th class="th" valign="top">邮件发送方式：</th>
                        <td class="td"><p><input size="30" name="sendtype" class="txt" value="{$sendtype}" /></p>
                        <p>使用mail函数发送请填mail或sendmail，使用smtp发送请填smtp。</p></td>
                    </tr>
                    <tr>
                        <th class="th" valign="top">服务器地址：</th>
                        <td class="td"><p><input size="30" name="host" class="txt" value="{$host}"/></p>
                        <p>发送邮箱的服务器地址。 </p></td>
                    </tr>
					<tr>
                        <th class="th" valign="top">是否启用SSL连接：</th>
                        <td class="td"><p><input size="30" name="ssl" class="txt" value="{$ssl}"/></p>
                        <p>此选项需要服务器环境支持SSL，启用请输入1或true，关闭请输入0或false</p></td>
                    </tr>
                    <tr>
                        <th class="th" valign="top">端口：</th>
                        <td class="td"><p><input size="30" name="port" class="txt" type="text" id="textfield" value="{$port}" /></p>
                        <p>smtp的端口。默认为25。具体请参看各STMP服务商的设置说明 </p></td>
                    </tr>
                    
                    <tr>
                        <th class="th" valign="top">用户名：</th>
                        <td class="td"><p><input size="30" name="account" class="txt" type="text" id="textfield" value="{$account}" /></p>
                        <p>用户名【留空时不验证用户名/密码】</p></td>
                    </tr>
					<tr>
						<th class="th" valign="top">密码：</th>
                        <td class="td"><p><input size="30" name="password" class="txt" type="text" id="textfield" value="{$password}" /></p>
                        <p>密码</p></td>
                    </tr>
					<tr>
						<th class="th" valign="top">默认的发件人名称：</th>
                        <td class="td"><p><input size="30" name="sender" type="text" class="txt" id="textfield" value="{$sender}" /></p>
                        <p>默认的发件人名称</p></td>
                    </tr>
					<tr>
						<th class="th" valign="top">默认的发件人帐户：</th>
                        <td class="td"><p><input size="30" name="sender_account" class="txt" type="text" id="textfield" value="{$sender_account}" /></p>
                        <p>默认的发件人帐户</p></td>
                    </tr>
					<tr>
						<th class="th" valign="top">单封邮件的人数限制：</th>
                        <td class="td"><p><input size="30" name="limit" class="txt" type="text" id="textfield" value="{$limit}" /></p>
                        <p>超过此限额将拆成多封邮件发送【默认：150】</p></td>
                    </tr>
                    <tr>
                        <th class="th" valign="top">&nbsp;</th>
                        <td class="td"><input type="submit" class="button" id="button" value="提交" /></td>
                    </tr>
					<tr>
                        <th class="th" valign="top">&nbsp;</th>
						<td class="td">&nbsp;</td>
                    </tr>
					<tr>
						<th class="th" valign="top">收件人：</th>
                        <td class="td">
							<p>
								<input size="30" name="test_account" class="txt" type="text" id="test_account" value="" />
								<input type="button" class="button" id="testEmail" value="发送测试邮件" onclick="sendTestMail()"/>
							</p>
							<p>接收测试邮件的收件人</p>
						</td>
                    </tr>
                </table>
            </form>
        </div>
    </body>
</html>
